package android.zhcs.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import android.zhcs.myapplication.databinding.ActivityMainBinding;

public class ksMainActivity2 extends AppCompatActivity {
private ActivityMainBinding binding;
    public static String lx;
    public static String rq;
    public static String sj;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getSupportActionBar().hide();
        binding = ActivityMainBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        setContentView(R.layout.activity_ks_main2);
        Spinner xz1 = findViewById(R.id.xz1);
        Spinner xz2 = findViewById(R.id.xz2);
        Spinner xz3 = findViewById(R.id.xz3);
        TextView an = findViewById(R.id.an);
        an.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(xz1.getSelectedItemPosition() == 0 && xz2.getSelectedItemPosition() == 0 && xz3.getSelectedItemPosition() == 0){
                    Toast.makeText(ksMainActivity2.this,"请选择信息",Toast.LENGTH_SHORT).show();
                }else{
                    lx = xz1.getSelectedItem().toString();
                    rq = xz2.getSelectedItem().toString();
                    sj = xz3.getSelectedItem().toString();
                    mmmMainActivity2.start(ksMainActivity2.this);
                }
            }
        });
    }
}